/**
 * 
 */
package com.test.test.utils;

import java.util.Collection;
import java.util.Map;

public final class CoreUtils {

	private CoreUtils() {
	};
	
	public static boolean isNull(Object obj) {
		return obj == null ? true : false;
	}
	
	public static boolean isNotNull(Object obj) {
		return !isNull(obj);
	}
	
	public static boolean isEmpty(Collection<?> c) {
		if (isNull(c)) {
			return true;
		}
		return c.size() < 1 ? true : false;
	}
	
	public static boolean isEmpty(Map<?, ?> m){
		if(isNull(m)) {
			return true;
		}
		return m.isEmpty();
	}
	
	public static boolean isEmpty(String s) {
		if (isNull(s)) {
			return true;
		}
		return s.trim().length() < 1 ? true : false;
	}

	public static <T> boolean isEmpty(T[] objs) {
		if (isNull(objs)) {
			return true;
		}
		return objs.length <= 0;
	}
	
	public static boolean isNotEmpty(Collection<?> c) {
		return !isEmpty(c);
	}
	
	public static boolean isNotEmpty(Map<?, ?> m){
		return !isEmpty(m);
	}
	
	public static boolean isNotEmpty(String s) {
		return !isEmpty(s);
	}

	public static <T> boolean isNotEmpty(T[] objs) {
		return !isEmpty(objs);
	}
	 
}
